2026-09-20 · help-desk, tcm, class-notes
An operating system (OS) manages the hardware and gives programs a consistent, safe way to use it. Without an OS, every application would need its own code to drive the disk, network card and screen — and nothing…
Class notes · TCM Security, Practical Help Desk · Section 6
Quick reference: the short version of this section is the Section 6 cheat sheet.
By the end of these notes you should be able to:
An operating system (OS) manages the hardware and gives programs a consistent, safe way to use it. Without an OS, every application would need its own code to drive the disk, network card and screen — and nothing would stop one program trampling on another.
Responsibility
What it means
Process management
Starting, scheduling and stopping programs; sharing the CPU between them
Memory management
Giving each program its own memory and keeping them apart
Storage management
File systems: organising data into files and folders on disk
Device management
Drivers that translate between the OS and each piece of hardware
Security
User accounts, permissions, authentication, isolation
User interface
A GUI (desktop) and CLIs (shells like PowerShell and Bash)
Networking
Network stacks so apps can communicate
Family
Kernel
Found on
Windows
NT kernel (hybrid)
Most business desktops and laptops; Windows Server
Linux
Linux (monolithic, with loadable modules)
Most servers, cloud, network appliances, Android, security tools
macOS / iOS / iPadOS
XNU (hybrid)
Apple devices
ChromeOS
Linux
Education and lightweight laptops
Linux distributions (distros) package the Linux kernel with tools and a desktop:
+-------------------------------------------------------+ | USERLAND (user mode / "ring 3") | | Browser Outlook PowerShell Services Your app | +--------------------------+----------------------------+ | system calls +--------------------------v----------------------------+ | KERNEL (kernel mode / "ring 0") | | Scheduler Memory manager File systems Drivers | +--------------------------+----------------------------+ | +--------------------------v----------------------------+ | HARDWARE CPU RAM Disk Network USB | +-------------------------------------------------------+
Kernel mode
User mode
Access
Unrestricted — any memory, any hardware
Restricted — only its own memory
What runs there
The kernel and drivers
Applications and most services
If it crashes
The whole system crashes (Windows blue screen, Linux kernel panic)
Only that program crashes
The CPU enforces the boundary with hardware privilege levels ("rings").
A user-mode program can't touch hardware directly. It asks the kernel with a system call — "open this file", "send these bytes", "start a process". The kernel checks permission, does the privileged work and returns the result.
Worked example — opening a document:
A driver is software that lets the OS talk to a specific piece of hardware. Most run in kernel mode, which is why a buggy driver can crash the whole system — faulty drivers are a leading cause of blue screens.
\
Get-PnpDevice -PresentOnly | Where-Object Status -ne 'OK' driverquery /v | more \
lsmod | head \
Concept
Meaning
Program
Code on disk, e.g. notepad.exe
Process
A running instance of a program, with its own memory space and a process ID (PID)
Thread
A sequence of execution within a process; a process can have many
Scheduler
Kernel component that decides which thread runs on which CPU core, and when
Context switch
Saving one thread's state and loading another's — thousands of times a second
Every process sees its own private address space, as if it had the machine to itself. The OS and the CPU's memory management unit (MMU) map those virtual addresses to physical RAM.
Benefits:
The cost: when RAM runs out and the OS constantly swaps to disk ("thrashing"), everything becomes painfully slow. That's the classic "PC slow with lots of tabs open" ticket; the fix is more RAM or fewer running programs.
Get-Process | Sort-Object WorkingSet64 -Descending | Select-Object -First 5 Name, Id, @{n='MB';e={[int]($_.WorkingSet64/1MB)}} ps aux --sort=-%mem | head -6 free -h
Stage
Windows
Linux
UEFI runs POST, initialises hardware
Same
Firmware reads the boot order and finds the EFI system partition
Same
Windows Boot Manager (bootmgfw.efi)
GRUB
ntoskrnl.exe plus boot drivers
vmlinuz plus initramfs
Session Manager (smss.exe) → wininit.exe / winlogon.exe
systemd (PID 1)
Service Control Manager (services.exe)
systemd units
Sign-in screen; user profile loads
Display manager or console login
Secure Boot checks that the bootloader is signed by a trusted key, so boot-level malware can't slip in before the OS.
A disk is just billions of numbered blocks. A file system organises them. It records:
Many also keep a journal: they log intended changes before making them, so a crash or power cut doesn't corrupt the structure.
File system
Used by
Max file size
Permissions
Journaling
Notes
NTFS
Windows system and data drives
Huge (16 TB+ in practice)
Yes (ACLs)
Yes
Encryption (EFS), compression, alternate data streams, shadow copies
FAT32
Old USB sticks, EFI partitions
4 GB
No
No
Works almost everywhere
exFAT
Modern USB sticks, SD cards
Huge
No
No
Cross-platform, no 4 GB limit
ReFS
Windows Server storage
Huge
Yes
Integrity streams
Resilience for large volumes
ext4
Linux default
16 TB
Yes
Yes
Mature, reliable
XFS
RHEL default
Huge
Yes
Yes
Large files, high performance
APFS
macOS
Huge
Yes
Copy-on-write
Snapshots, native encryption, SSD-optimised
A file system allocates space in clusters. With 4 KB clusters, a 1-byte file still uses 4 KB on disk ("size on disk" vs "size" in File Properties). Larger clusters waste space on small files but can speed up very large ones.
A partition is a slice of a disk; each holds one file system (a volume).
MBR
GPT
Firmware
Legacy BIOS
UEFI
Max disk size
2 TB
Effectively unlimited
Partitions
4 primary (or 3 + extended)
128 on Windows
Resilience
Single partition table
Primary and backup tables, with CRC checks
A typical Windows GPT disk:
[EFI System (FAT32, ~100 MB)] [MSR (16 MB)] [Windows C: (NTFS)] [Recovery (NTFS)]
Scenario
Choice
Reason
Windows laptop system drive
NTFS
Permissions, encryption, journaling
USB stick shared between Windows and Mac, with 6 GB videos
exFAT
Cross-platform, no 4 GB limit
USB stick for an old car stereo
FAT32
Maximum compatibility; files are small
Ubuntu server data disk
ext4 (or XFS)
Linux-native, journaled, permissions
External drive for a Mac's Time Machine
APFS
macOS-native backup target
Get-Disk \
Get-Partition Get-Volume \
fsutil fsinfo ntfsinfo C: \
lsblk -f \
df -Th \
sudo fdisk -l \
Caution: formatting erases a volume. Commands like Format-Volume and mkfs.ext4 destroy data on the target instantly. Triple-check the drive letter or device name, and confirm backups first.
OS
Method
Windows
Mainly the extension (.docx, .exe). File associations map each extension to a program
Linux
Doesn't rely on extensions. Executability comes from the permission bit; tools like file inspect the content
macOS
Extensions plus type metadata
Web browsers and servers
MIME types, e.g. text/html, application/pdf, image/png
In Command Prompt, assoc .txt shows the file type an extension maps to (e.g. .txt=txtfile), and ftype txtfile shows the command that opens it:
assoc .txt ftype txtfile
Category
Extensions
Executables
.exe, .msi (installer), .dll (library), .com, .scr (screensaver — also an executable)
Scripts
.ps1, .bat, .cmd, .vbs, .js, .hta, .sh, .py
Documents
.docx, .xlsx, .pptx, .pdf, .txt, .csv, .rtf
Macro-enabled Office
.docm, .xlsm, .pptm
Archives and images
.zip, .7z, .rar, .iso, .img
Media
.jpg, .png, .gif, .mp3, .mp4
Shortcuts
.lnk (Windows), .url
Many formats begin with a fixed signature — a magic number — in their first bytes:
Format
First bytes (hex)
As text
Windows executable (PE)
4D 5A
MZ
Linux executable (ELF)
7F 45 4C 46
.ELF
25 50 44 46
ZIP (and .docx / .xlsx, which are ZIP files)
50 4B 03 04
PK..
PNG
89 50 4E 47
.PNG
JPEG
FF D8 FF
—
Worked example — is this "invoice" really a PDF?
A user received invoice.pdf and double-clicking it did "nothing".
Format-Hex .\invoice.pdf.exe | Select-Object -First 1- It starts 4D 5A ("MZ") — a Windows program, not a document.
Linux equivalent:
file invoice.pdf \
xxd invoice.pdf | head -n 1
Term
Definition
Operating system
Software that manages hardware and provides services to programs
Kernel
The core of the OS, running with full privileges
Userland / user mode
Restricted environment where applications run
System call
A request from a program to the kernel for a privileged service
Driver
Software that lets the OS control a specific device
Process / PID
A running program / its process ID
Thread
A unit of execution within a process
Scheduler
The kernel part that decides which thread runs when
Virtual memory
A private address space per process, mapped to physical RAM by the MMU
Page file / swap
Disk space used as overflow for RAM
Thrashing
Constant swapping that makes a system crawl
Bootloader
Program that loads the OS kernel (Windows Boot Manager, GRUB)
File system
A structure that organises data on a volume into files and folders
Journaling
Logging changes before making them, to survive crashes
Cluster / allocation unit
The smallest unit of disk space a file system allocates
Partition / volume
A slice of a disk / a formatted partition
MBR / GPT
Legacy / modern partition table formats
File association
Mapping from a file extension to the program that opens it
MIME type
A standard label for content type used on the web
Magic number
Fixed bytes at the start of a file identifying its format
Alternate data stream
NTFS feature allowing hidden extra data attached to a file